﻿namespace BasicParts
{
    public struct Point
    {
        public int X, Y;
        //public Point() { X = Y = 0; }
        public Point(int xy) { this.X = this.Y = xy; }
        public Point(int X, int Y) { this.X = X; this.Y = Y; }

        public static Point Zero { get { return new Point(); } }

        public override string ToString()
        {
            return X.ToString() + ", " + Y.ToString();
        }

        public static Point operator -(Point v)
        {
            return new Point(-v.X, -v.Y);
        }

        public static Point operator *(int i, Point v)
        {
            return new Point(v.X * i, v.Y * i);
        }
        public static Point operator *(Point v, int i)
        {
            return new Point(v.X * i, v.Y * i);
        }

        public static Point operator *(float i, Point v)
        {
            return new Point((int)(v.X * i), (int)(v.Y * i));
        }
        public static Point operator *(Point v, float i)
        {
            return new Point((int)(v.X * i), (int)(v.Y * i));
        }

        public static Point operator +(Point v1, Point v2)
        {
            return new Point(v1.X + v2.X, v1.Y + v2.Y);
        }

        public static Point operator -(Point v1, Point v2)
        {
            return new Point(v1.X - v2.X, v1.Y - v2.Y);
        }

        public static Point operator +(Point v1, Vector2 v2)
        {
            return new Point(v1.X + (int)v2.X, v1.Y + (int)v2.Y);
        }

    }
}
